import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/news/list',
    method: 'get',
    params: query
  })
}

export function fetchNews(id) {
  return request({
    url: '/news/detail/' + id,
    method: 'get'
  })
}

export function createNews(data) {
  return request({
    url: '/news/add',
    method: 'post',
    data
  })
}

export function updateNews(data) {
  return request({
    url: '/news/update',
    method: 'post',
    data
  })
}
